package cn.consumer;

import java.util.concurrent.BlockingQueue;

public class Producer extends Thread{
	private BlockingQueue<Integer> queue;
	public Producer(BlockingQueue<Integer> queue){
		this.queue=queue;
	}
	@Override
	public void run(){
	   produce();	
	}
	private void produce(){
		while(true){
			try {
				queue.put(11);
				System.out.println("after put size:"+queue.size());
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}
	
}
